import { defineUniPages } from '@uni-helper/vite-plugin-uni-pages'

export default defineUniPages({
  easycom: {
    autoscan: true,
    custom: {
      '^u-(.*)': 'uview-plus/components/u-$1/u-$1.vue',
      '^uni-(.*)': '@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue',
      '^(?!z-paging-refresh|z-paging-load-more)z-paging(.*)':
        'z-paging/components/z-paging$1/z-paging$1.vue',
    },
  },
  pages: [
    {
      path: 'pages/index/home/index',
      aliasPath: '/',
      style: {
        navigationBarTitleText: '主页',
      },
    },
    {
      path: 'pages/index/personal/index',
      aliasPath: '/personal',
      style: {
        navigationBarTitleText: '我的',
      },
    },
    {
      path: 'pages/index/personal/memberInfo/index',
      aliasPath: '/personal/memberInfo',
      style: {
        navigationBarTitleText: '会员信息',
      },
    },
    {
      path: 'pages/login/account/index',
      aliasPath: '/login',
      style: {
        navigationStyle: 'custom',
      },
    },
    {
      path: 'pages/register/account/index',
      aliasPath: '/register',
      style: {
        navigationBarTitleText: '注册',
      },
    },
    {
      path: 'pages/errors/404/index',
      aliasPath: '/404',
      style: {
        navigationBarTitleText: '404',
      },
    },
  ],
  subPackages: [
    {
      root: 'pages/webview',
      pages: [
        {
          path: 'index',
          aliasPath: '/webview',
          style: {
            navigationBarTitleText: 'webview',
          },
        },
      ],
    },
    {
      root: 'pages/contact',
      pages: [
        {
          path: 'index',
          aliasPath: '/contact',
          style: {
            navigationBarTitleText: '联系我们',
          },
        },
      ],
    },
  ],
  tabBar: {
    color: '#999999',
    selectedColor: '#fc2c2c',
    backgroundColor: '#F8F8F8',
    list: [
      {
        iconPath: 'static/tabbar/tab-home.png',
        selectedIconPath: 'static/tabbar/tab-home-active.png',
        pagePath: 'pages/index/home/index',
      },
      {
        iconPath: 'static/tabbar/tab-personal.png',
        selectedIconPath: 'static/tabbar/tab-personal-active.png',
        pagePath: 'pages/index/personal/index',
      },
    ],
  },
  globalStyle: {
    navigationBarTextStyle: 'black',
    navigationBarTitleText: 'Simple-Uni',
    navigationBarBackgroundColor: '#ffffff',
    backgroundColor: '#f8f8f8',
  },
  condition: {
    current: 0,
    list: [
      {
        name: 'pages/contact/index',
        path: 'pages/contact/index',
      },
    ],
  },
})
